package com.ice.app;

import javax.annotation.PostConstruct;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.core.annotation.Order;

@SpringBootApplication
@EnableDiscoveryClient
//改变自动扫描的包
@ComponentScan(basePackages = {"com.iceframework.**","com.ice.**"})
@MapperScan("com.ice.app.**.mapper")
public class AuthorityBootstrap {

	protected final Log logger = LogFactory.getLog(getClass());

	/**
	 * 初始化方法 order为执行顺序
	 */
	@PostConstruct
	@Order(1)
	public void postConstruct() {
		logger.info("----------------------- Init System Resource -----------------------");
		// 初始化资源放在这里

		logger.info("-----------------------     Init Succeed     -----------------------");
	}

	public static void main(String[] args) {
		SpringApplication.run(AuthorityBootstrap.class, args);
	}
}